package com.user.controller;


import com.user.model.vo.QueryServerInfoVo;
import com.user.model.vo.ServerChuZuVo;
import com.user.param.Result;
import com.user.service.ServerCZService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Api(value = "云出租")
@RestController
@RequestMapping(value = "/cz")
public class ServerCZController {

    @Autowired
    private ServerCZService serverCZService;

    @ApiOperation(value = "出租接口")
    @RequestMapping(value = "/serverChuzu",method = RequestMethod.POST)
    public Result serverChuzu(@RequestBody @Validated ServerChuZuVo serverChuZuVo){
        return serverCZService.serverChuzu(serverChuZuVo);
    }

    @ApiOperation(value = "查询服务器列表")
    @RequestMapping(value = "/getServerList",method = RequestMethod.POST)
    public Result getServerList(@RequestBody @Validated QueryServerInfoVo QueryServerInfoVo){
        return serverCZService.getServerList(QueryServerInfoVo);
    }

    @ApiOperation(value = "收益信息")
    @RequestMapping(value = "/getServerBeCZ",method = RequestMethod.POST)
    public Result getServerBeCZ(){
        return serverCZService.getServerBeCZ();
    }

}
